package com.ztw.yygh.cmn.controller;

import com.ztw.yygh.cmn.service.DepartmentService;
import com.ztw.yygh.common.result.Result;
import com.ztw.yygh.vo.hosp.DepartmentVo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/admin/hosp/department")
public class DepartmentController {
    @Resource
    private DepartmentService departmentService;

    //根据医院编号，查询医院所有科室信息
    @GetMapping("getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable String hoscode) {
        List<DepartmentVo> list = departmentService.findDeptTree(hoscode);
        return Result.ok(list);
    }
}
